package com.it.recycleviewdemo;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.LinearLayout;

import com.zhy.autolayout.AutoLayoutActivity;


public class TestAutoActivity extends AutoLayoutActivity {

    private View mv;
    GridLayoutManager gridLayoutManager;

    LinearLayoutManager manager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.auto_layout);
        mv = findViewById(R.id.v);
        mv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(final View v) {
                LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) mv.getLayoutParams();
                layoutParams.leftMargin = 200;

                layoutParams.width = 500;

                mv.setLayoutParams(layoutParams);
                mv.post(new Runnable() {
                    @Override
                    public void run() {

                        mv.getWidth();
                    }
                });
            }
        });


    }








}
